package com.sheliduan.itlearning.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sheliduan.itlearning.common.domain.dos.OrderDO;
import com.sheliduan.itlearning.common.domain.dos.UserCollectDO;

/**
 * @author: 断舍离
 * @date: 2025/2/10 10:14
 * @description: 用户收藏映射接口
 **/
public interface UserCollectMapper extends BaseMapper<UserCollectDO> {

    default Page<UserCollectDO> selectPageList(long current, long size, Integer userId){
        // MyBatis分页对象, 需传入当前页码和每页记录数
        Page<UserCollectDO> page = new Page<>(current, size);
        LambdaQueryWrapper<UserCollectDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserCollectDO::getUserId, userId);
        return selectPage(page, wrapper);
    }
}
